

namespace Stee.CAP8.MessageBus.Kafka.Constants
{
    /// <summary>
    /// Constants for admin client, producer & consumer of Kafka message broker
    /// </summary>
    public static class ConfigurationConstants
    {
        #region Broker Constants

        /// <summary>
        /// Default broker configuration file
        /// </summary>
        internal const string DefaultBrokerConfigurationJSON = "defaultBrokerConf.json";

        /// <summary>
        /// Section name for admin configuration
        /// </summary>
        public const string BrokerConfigAdminSection = "AdminConfig";

        /// <summary>
        /// Section name for publish configuration
        /// </summary>
        public const string BrokerConfigPublishSection = "PublishConfig";

        /// <summary>
        /// Section name for subscribe configuration
        /// </summary>
        public const string BrokerConfigSubscribeSection = "SubscribeConfig";

        #endregion Broker Constants


        #region Topic & Group Constants

        /// <summary>
        /// Default topic configuration file
        /// </summary>
        internal const string DefaultTopicConfigurationJSON = "defaultTopicConfigs.json";

        /// <summary>
        /// Section name for dead-letter queue (DLQ) topic configurations
        /// </summary>
        public const string TopicDLQConfigSection = "DeadLetterConfigs";

        /// <summary>
        /// Section name for topic configuration list
        /// </summary>
        public const string TopicConfigSection = "Topics";

        /// <summary>
        /// Post fix extension for dead letter queue topic 
        /// </summary>
        internal const string TopicNamePostFixDLQ = "_dlq";

        /// <summary>
        /// Consumer group name for consuming dead-letter topics
        /// </summary>
        internal const string DLQConsumerGroup = "dlq_consumer_group";

        #endregion Topic & Group Constants


        #region Admin Config

        /// <summary>
        /// Timeout delay to query admin data
        /// </summary>
        internal const int AdminQueryTimeoutSeconds = 30;

        /// <summary>
        /// Timeout delay to complete admin operation
        /// </summary>
        internal const int AdminOperationTimeoutSeconds = 60;

        /// <summary>
        /// Config: bootstrap server URLs
        /// </summary>
        internal const string AdminCfgBootstrapServers = "BootstrapServers";

        #endregion Admin Config


        #region Producer Config

        /// <summary>
        /// Timeout delay to complete produce operation
        /// </summary>
        internal const int ProduceOperationTimeoutSeconds = 30;


        internal const string ProducerCfgBootstrapServers = "BootstrapServers";


        internal const string ProducerCfgAcks = "Acks";


        internal const string ProducerCfgClientID = "ClientID";


        internal const string ProducerCfgEnableIdempotence = "EnableIdempotence";


        internal const string ProducerCfgLingerMs = "LingerMs";


        internal const string ProducerCfgMessageSendMaxRetries = "MessageSendMaxRetries";


        internal const string ProducerCfgMessageTimeoutMs = "MessageTimeoutMs";


        internal const string ProducerCfgQueueBufferingMaxKbytes = "QueueBufferingMaxKbytes";


        internal const string ProducerCfgQueueBufferingMaxMessages = "QueueBufferingMaxMessages";


        internal const string ProducerCfgTransactionTimeoutMs = "TransactionTimeoutMs";

        #endregion Producer Config


        #region Consumer Config


        internal const string ConsumerCfgBootstrapServers = "BootstrapServers";


        internal const string ConsumerCfgGroupID = "GroupID";


        internal const string ConsumerCfgClientID = "ClientID";


        internal const string ConsumerCfgAutoOffsetReset = "AutoOffsetReset";


        internal const string ConsumerCfgEnableAutoCommit = "EnableAutoCommit";


        internal const string ConsumerCfgAutoCommitIntervalMs = "AutoCommitIntervalMs";


        internal const string ConsumerCfgEnableAutoOffsetStore = "EnableAutoOffsetStore";


        internal const string ConsumerCfgMaxPollIntervalMs = "MaxPollIntervalMs";


        internal const string ConsumerCfgSessionTimeoutMs = "SessionTimeoutMs";


        internal const string ConsumerCfgCheckCrcs = "CheckCrcs";


        internal const string ConsumerCfgPartitionAssignmentStrategy = "PartitionAssignmentStrategy";

        #endregion Consumer Config
    }
}
